﻿<%@ Page Language="C#"  MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmArea.aspx.cs" Inherits="ddcCajamarca.Web.Documentos.frmArea" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    
    <div class="row">
        <div class="col-sm-6">
            <asp:FormView ID="fvArea" runat="server" Width="100%"
                DefaultMode="Edit"
                SelectMethod="GetArea"
                UpdateMethod="UpdateArea"
                InsertMethod="InsertArea"
                ItemType="ddcCajamarca.BusinessEntities.Documentos.Area">
                <InsertItemTemplate>                    
                  <div>
                        <div class="panel panel-primary">
                            <div class="panel-heading">
                                Registrar Area
                            </div>
                            <div class="panel-body">
                               
                                <div class="form-group">
                                    <label>Nombre*</label>
                                    <asp:TextBox ID="txtNombre" placeholder="Ejm: Arquitectura" Text="<%# BindItem.NombreArea %> " 
                                        CssClass="form-control input-sm" runat="server" MaxLength="30"/>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtNombre" ErrorMessage="* Campo necesario" ForeColor="Red"></asp:RequiredFieldValidator>
                                </div>   
                                <div class="form-group">
                                    <label>Descripcion*</label>
                                    <asp:TextBox ID="txtDescripcion" placeholder="Ejm: Departamento de Arquitectura" Text="<%# BindItem.DescripcionArea %>" 
                                        CssClass="form-control input-sm" runat="server" MaxLenght="100"/>
                                     <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDescripcion" ErrorMessage="* Campo necesario" ForeColor="Red"></asp:RequiredFieldValidator>
                                     
                                </div>
                              
                            <div class="panel-footer">
                                <asp:Button ID="btnGuardar" CommandName="insert" CssClass="btn btn-success" Text="Guardar" runat="server"/>
                                <a href="frmListAreas.aspx" class="btn btn-danger" style="color:#ffffff;"> Cancelar</a>
                            </div>
                        </div>
                        <div class="bg-danger">
                            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtNombre" Text="*" Display="Dynamic" Type="String" Operator="DataTypeCheck"
                                ErrorMessage="CompareValidator"></asp:CompareValidator>
                                <asp:ValidationSummary ID="vsInsert" runat="server"
                            ShowModelStateErrors="True"/>
                         </div>
                    </div>                  
                </InsertItemTemplate>
                
                <EditItemTemplate>                  
                    <div>
                        <div class="panel panel-warning">
                            <div class="panel-heading">
                                Actualizar Areas
                            </div>
                            <div class="panel-body">
                                <div class="form-group">
                                    <label>Id:</label>
                                    <asp:TextBox ID="txtId" Text="<%# BindItem.Id %>" 
                                        CssClass="form-control input-sm" Enabled="False" runat="server"/>
                                </div>
                                <div class="form-group">
                                    <label>Nombre:</label>
                                    <asp:TextBox ID="txtNombre" Text="<%# BindItem.NombreArea %>" 
                                        CssClass="form-control input-sm" runat="server" MaxLength="20"/>                                    
                                    
                                </div>
                                <div class="form-group">
                                    <label>Descripcion:</label>
                                    <asp:TextBox ID="txtDescripcion" Text="<%# BindItem.DescripcionArea%>" 
                                        CssClass="form-control input-sm" runat="server" MaxLenght="100"/>
                                   <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator4" 
                                        runat="server" ErrorMessage="Debe ingresar solo letras." 
                                        ControlToValidate="txtDescripcion" ValidationExpression="^[a-z A-Z.1-9]*$" 
                                        ValidationGroup="SOLOLETRAS"></asp:RegularExpressionValidator>--%>
                                    </div>         
                                                  
                            </div>
                            <div class="panel-footer">
                                <asp:Button ID="btnGuardar" CommandName="update" CssClass="btn btn-success" Text="Guardar" runat="server"/>
                                <a href="frmListAreas.aspx" class="btn btn-danger" style="color:#ffffff;"> Cancelar</a>
                            </div>
                        </div>
                        <div class="bg-danger">
                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                            ShowModelStateErrors="True"/>
                          </div>


                    </div>
                </EditItemTemplate>
            </asp:FormView>
        </div>
    </div>
</asp:Content>